TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

CONFIG += c++17
INCLUDEPATH += $$PWD/.
DEPENDPATH += $$PWD/.

# ==================== 系统环境判断 ====================
# 判断是否为 Linux 系统
linux {
	QMAKE_CFLAGS_RELEASE += -g -gpubnames -gstrict-dwarf -fno-inline-small-functions -fno-omit-frame-pointer
	QMAKE_CXXFLAGS_RELEASE += -g -gpubnames -gstrict-dwarf -fno-inline-small-functions -fno-omit-frame-pointer
	QMAKE_LFLAGS_RELEASE -= -Wl,-s
	HEADERS += crash_dump_linux.h
	SOURCES += main_linux.cpp
	LIBS += -lbacktrace
}

# 判断是否为 Windows 系统
win32 {
	# ==================== Windows 编译器判断 ====================
	# 判断是否为 MSVC 编译器 (Visual Studio)，建议在 VS2022里借助 Qt Extension 打开本pro文件，转换为 sln 编译。
	win32-msvc* {
		HEADERS += crash_dump_msvc.h
		SOURCES += main_msvc.cpp
		QMAKE_CXXFLAGS += -arch:SSE2
		DEFINES += _UNICODE UNICODE
	} else {
	QMAKE_CFLAGS_RELEASE += -g -gpubnames -gstrict-dwarf -fno-inline-small-functions -fno-omit-frame-pointer
	QMAKE_CXXFLAGS_RELEASE += -g -gpubnames -gstrict-dwarf -fno-inline-small-functions -fno-omit-frame-pointer
	QMAKE_LFLAGS_RELEASE -= -Wl,-s
	HEADERS += crash_dump_mingw.h
	SOURCES += main_mingw.cpp
	LIBS += -lbacktrace
	}
}
